package dataStructure;

public class MyArrayList<E> extends AbstractList{

    private int size=0;
    private Object[] arr = new Object[20];

    @Override
    public int size() {
        return size;
    }

    @Override
    public void add(Object o, int index) {
        // 数组不够大则扩容
        if (size >= arr.length){
            Object[] arr =new Object[this.arr.length + 10];
            for (int i =0;i< this.arr.length;i++){
                arr[i] = this.arr[i];
            }
        }
        arr[index] = o;
        size++;
    }

    @Override
    public Object remove(int index) {
        return null;
    }

    @Override
    public Object get(int index) {
        return null;
    }
}
